<html>
<head><meta charset="utf-8"><title>term in the Rust libraries · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html">term in the Rust libraries</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="242792650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242792650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242792650">(Jun 15 2021 at 20:13)</a>:</h4>
<p>Does the <code>term</code> crate now live at &lt;<a href="https://github.com/rust-lang/rust/tree/master/library/term">https://github.com/rust-lang/rust/tree/master/library/term</a>&gt; or &lt;<a href="https://github.com/Stebalien/term">https://github.com/Stebalien/term</a>&gt;? They seem to be the same and <a href="http://crates.io">crates.io</a> says the official repo is the latter so shouldn't maybe Rust pull it from &lt;<a href="https://github.com/Stebalien/term">https://github.com/Stebalien/term</a>&gt; instead of duplicating?</p>



<a name="242793599"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242793599" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242793599">(Jun 15 2021 at 20:20)</a>:</h4>
<p>I think the intent is that <code>std</code> is wholly controlled by the rust-lang org</p>



<a name="242794221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242794221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242794221">(Jun 15 2021 at 20:24)</a>:</h4>
<p>So for instance in <code>std</code>'s Cargo.toml you have external crates as well: <a href="https://github.com/rust-lang/rust/blob/master/library/std/Cargo.toml">https://github.com/rust-lang/rust/blob/master/library/std/Cargo.toml</a> and they aren't all owned/controlled by the <code>rust-lang</code> org so I was wondering if you can't just add <code>term</code> to whatever crate's Cargo.toml where you need the <code>term</code> crate and as I said pull it from that repo</p>



<a name="242796355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242796355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> cuviper <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242796355">(Jun 15 2021 at 20:40)</a>:</h4>
<p>then I don't know</p>



<a name="242799578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242799578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242799578">(Jun 15 2021 at 21:04)</a>:</h4>
<p>I guess the one on crates IO is a fork. When I do <code>git log --follow library/term/src/lib.rs</code> it goes back to 2011. The external crate only goes back to 2014</p>



<a name="242801569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242801569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242801569">(Jun 15 2021 at 21:21)</a>:</h4>
<p>Yeah I feel like it was done to get it out of the <code>rust</code> repo into a general crate which makes more sense but then I guess they kind of forgot to remove it from <code>library</code>? A Rust member contributed to the fork so I think they're aware of it.</p>



<a name="242802491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242802491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> The 8472 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242802491">(Jun 15 2021 at 21:30)</a>:</h4>
<p>It's not even used by std, on the opposite, it has std as path dependency. It's only used by the <code>library/test</code> crate as far as I can see from grepping through toml files. <code>rustfmt</code> uses the one from <a href="http://crates.io">crates.io</a>.</p>



<a name="242803150"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242803150" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242803150">(Jun 15 2021 at 21:37)</a>:</h4>
<p>Then it can be removed from <code>rust/library</code> and pulled from <a href="http://crates.io">crates.io</a> by adding it here right? <a href="https://github.com/rust-lang/rust/blob/master/library/test/Cargo.toml">https://github.com/rust-lang/rust/blob/master/library/test/Cargo.toml</a><br>
Does the library team agree?</p>



<a name="242834747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242834747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242834747">(Jun 16 2021 at 06:25)</a>:</h4>
<p>IIRC the version in the rust stdlib has a few fixes not present in the <a href="http://crates.io">crates.io</a> version</p>



<a name="242834774"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242834774" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242834774">(Jun 16 2021 at 06:25)</a>:</h4>
<p>It's only used by libtest, that's correct</p>



<a name="242834933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242834933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242834933">(Jun 16 2021 at 06:27)</a>:</h4>
<p>The <code>term</code> crate on <a href="http://crate.io">crate.io</a> has been on-and-off maintained (IIUC it's not actually unmaintained, but it has been called that before, and I think the maintainer has expressed they don't want to be that anymore). I had assumed that that was why it never was removed from the stdlib</p>



<a name="242835015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242835015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242835015">(Jun 16 2021 at 06:27)</a>:</h4>
<p>I've followed this a bit in the past — I don't think this is super straightforward, and my real opinion is that things are probably better off as they are now.</p>



<a name="242835115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242835115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Thom Chiovoloni <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242835115">(Jun 16 2021 at 06:28)</a>:</h4>
<p>(also, regarding alternatives in the ecosystem, almost none of them respect <code>terminfo</code>, which IMO should be a hard requirement for a replacement. that said, I'm not on the libs team so its not really my call of course)</p>



<a name="242852143"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242852143" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242852143">(Jun 16 2021 at 09:14)</a>:</h4>
<p>we generally avoid dependencies that are not under our control under <code>rust-lang/</code>. and in this specific case, that <code>term</code> crate isn't actively maintained either (<a href="https://github.com/Stebalien/term/issues/93">https://github.com/Stebalien/term/issues/93</a>). so that's another reason to not depend on it. it'd mean that we can't fix bugs in libtest if they originate in the <code>term</code> crate.</p>



<a name="242861589"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242861589" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242861589">(Jun 16 2021 at 10:32)</a>:</h4>
<p>Hmm in <a href="https://github.com/Stebalien/term/issues/93#issuecomment-631224393">https://github.com/Stebalien/term/issues/93#issuecomment-631224393</a> they said that they would merge PRs and fixes if there were any so couldn't the patches be sent there? Their last contribution happened 1 day ago so they are still active and would probably look at PRs.<br>
If not that, maybe this crate should be moved to <code>rust-lang/term</code> so that it can depend on its own <code>rust-lang</code> dependency? I do believe there's people (me included) that would like to make use of <code>rust-lang</code>'s official-ish terminal coloring library. But the fact that Stebalien's repository currently occupies the <code>term</code> crate name makes it harder to publish to <code>crates.io</code> of course so maybe some negotiations could be done so that <code>rust-lang</code> gets the name? They are looking for other maintainers anyway and seem ready to "give up" the crate (name).</p>



<a name="242863350"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242863350" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242863350">(Jun 16 2021 at 10:50)</a>:</h4>
<p>if we need to send patches there, we need to be able to rely on them getting reviewed and merged, which means that we need to be able merge PRs and push new releases if needed (just like for the libc crate, etc.)</p>



<a name="242863458"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/242863458" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#242863458">(Jun 16 2021 at 10:50)</a>:</h4>
<p>we can consider publishing the <code>term</code> crate that's inside <code>rust-lang/rust</code>. but that means we now need to maintain an extra public api, handle publication of it with versioning etc. we don't have the bandwith for that right now.</p>



<a name="246368268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/246368268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#246368268">(Jul 18 2021 at 09:12)</a>:</h4>
<p>I'm bringing a discussion up again from quite some time ago but the PR <a href="https://github.com/rust-lang/rust/pull/87247">https://github.com/rust-lang/rust/pull/87247</a> has just been made and it merges <code>term</code> into <code>test</code> but I just noticed that in other places the compiler uses <code>termcolor</code> to colorize output (<a href="https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_errors/Cargo.toml#L19">https://github.com/rust-lang/rust/blob/673d0db5e393e9c64897005b470bfeb6d5aec61b/compiler/rustc_errors/Cargo.toml#L19</a>) and I'm wondering why <code>termcolor</code> isn't just used for tests too instead of <code>term</code> so that <code>term</code> could perhaps be removed altogether?<br>
Why have two terminal colorization libraries (<code>term</code> and <code>termcolor</code>) instead of just one?</p>



<a name="246373042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/246373042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> BurntSushi <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#246373042">(Jul 18 2021 at 11:35)</a>:</h4>
<p>I don't have any insight as to why two different libs are being used, but keep in mind that different teams own different areas of the code. So there might not be much of a "let's think about this holistically for the whole repo" check on these sorts of things.</p>
<p>Another thing to keep in mind, IIRC, is that term might support more things than termcolor. The only thing termcolor has is basic styling. I'm not sure what requirements libtest has.</p>



<a name="246375100"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/246375100" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#246375100">(Jul 18 2021 at 12:27)</a>:</h4>
<p>I think it's historical artifact more than anything else, my guess is libterm in-tree was in existence before termcolor, and certainly before we could use <a href="http://crates.io">crates.io</a> deps for std.</p>
<p>I wouldn't personally be inclined to change term to termcolor or similar without strong motivation, since it seems plausible to have subtle differences that'll be hard to check for and isn't really a maintenance burden right now</p>



<a name="246380523"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/246380523" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#246380523">(Jul 18 2021 at 14:05)</a>:</h4>
<p><span class="user-mention" data-user-id="376093">@ruster</span> Keep in mind that <code>libtest</code> and <code>libterm</code> are libraries that got linked into user-generated unit test executables. This is quite different from the compiler-usage case.</p>



<a name="246382650"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/term%20in%20the%20Rust%20libraries/near/246382650" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> ruster <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/term.20in.20the.20Rust.20libraries.html#246382650">(Jul 18 2021 at 14:52)</a>:</h4>
<p>I see</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>